package com.ccom.ccomstart.validation;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zjj
 * @date 2021/9/13 10:18
 * @description
 */
@RestController
@RequestMapping("/validation")
public class ValidationController {
    @PostMapping("/save1")
    private String putPersion1(@RequestBody Persion Persion) {
        return "success";
    }

    @PostMapping("/save2")
    private String putPersion2(@RequestBody @Validated Persion Persion) {
        return "success";
    }
}
